package payroll.webapp

class Employee {
	Integer emp_id
	PersonDetails person
	Boolean active
	Date hireDate
	Date endDate
	Date resignationDate
	Integer noticePeriod
	BaseSalary salary
	Designation designation
	Department department
	StatusCode statusCode
	Address presentAddress
	Date dateCreated
	Date lastUpdated
	String createdBy
	String lastModifiedBy
	Boolean holdSalary // Hold the Salary of the Employee for some reason..
	EmployeeCostCenter empCostCenter //Checks if the employee belongs to Optimum or another Cost Center
	EmpBankDetails bankDetails // Preserves the bank Details of the Employee
	ResidentialTypes residentialTypes//Residential Types her
	
    static constraints = {
		emp_id(nullable:false,blank:false,unique:true)
		active(nullable:true)
		hireDate(nullable:true)
		endDate(nullable:true)
		resignationDate(nullable:true)
		person(nullable:false)
		salary(nullable:true)
		presentAddress(nullable:true)
		designation(nullable:true)
		department(nullable:true)
		statusCode(nullable:true)
		dateCreated(nullable:true)
		lastUpdated(nullable:true)
		createdBy(nullable:true)
		lastModifiedBy(nullable:true)
		holdSalary(nullable:true,default:false)
		empCostCenter(nullable:true)
		bankDetails(nullable:true)
		noticePeriod(nullable:true)
		residentialTypes(nullable:true)
    }
	
	static mapping = {
		table "employees"
	}
}
